package com.atde._04_structural_design_patterns.adapter.classadapter;


/**
 * @BelongsProject: hsp_java_design_mode
 * @BelongsPackage: com.atde._04_structural_design_patterns.adapter.classadapter
 * @Author: Del
 * @CreateTime: 2025-06-18  19:59
 * @Description: 手机类 --- 使用适配器进行充电
 * @Version: 1.0
 */
public class Phone {
    public void charging (IVoitage5V iVoitage5V ) {
        if (iVoitage5V.output5V() == 5) {
            System.out.println("电压为5V, 可以充电");
        } else if (iVoitage5V.output5V() > 5) {
            System.out.println("电压大于5V, 不能充电");
        }
    }
}
